package com.framework.model.module.job;

import com.framework.common.annotation.QueryParam;
import com.framework.common.model.validation.ValidationGroup;
import com.framework.common.util.other.NumeralUtil;
import com.framework.model.base.BaseModel;
import java.io.Serializable;
import java.util.Date;
import javax.validation.constraints.Digits;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * @author 龘鵺
 * @version 1.0
 * @className com.framework.model.module.job.ScheduledTasksLog
 * @title 定时任务日志类
 * @datetime 2025-04-25 09:06:26
 */
public class ScheduledTasksLog extends BaseModel implements Serializable {
    /**
     * 定时任务编号 SCHEDULED_TASKS_ID
     */
    @NotNull(message = "定时任务错误", groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQueryItem.class})
    @Min(message = "定时任务错误", value = NumeralUtil.POSITIVE_ONE, groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQueryItem.class})
    @Max(message = "定时任务错误", value = Long.MAX_VALUE, groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQueryItem.class})
    @QueryParam(name = "scheduledTasksId", code = "p.SCHEDULED_TASKS_ID")
    private Long scheduledTasksId;

    /**
     * 任务名称 NAME
     */
    @NotBlank(message = "请输入任务名称", groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class})
    @Size(message = "任务名称最多64字符", max = 64, groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class})
    @QueryParam(name = "name", code = "p.NAME")
    private String name;

    /**
     * 任务编码 CODE
     */
    @NotBlank(message = "请输入任务编码", groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class})
    @Size(message = "任务编码最多64字符", max = 64, groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class})
    @QueryParam(name = "code", code = "p.CODE")
    private String code;

    /**
     * 任务参数 PARAM
     */
    @NotBlank(message = "请输入任务参数", groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class})
    @Size(message = "任务参数最多512字符", max = 512, groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class})
    @QueryParam(name = "param", code = "p.PARAM")
    private String param;

    /**
     * 执行第几次 EXECUTE_INDEX
     */
    @NotNull(message = "请选择执行第几次", groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class})
    @Min(message = "执行第几次错误", value = NumeralUtil.POSITIVE_ONE, groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class})
    @Max(message = "执行第几次错误", value = Integer.MAX_VALUE, groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class})
    @QueryParam(name = "executeIndex", code = "p.EXECUTE_INDEX")
    private Integer executeIndex;

    /**
     * 执行状态 EXECUTE_STATUS
     */
    @NotNull(message = "请选择执行状态", groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class})
    @Min(message = "执行状态错误", value = NumeralUtil.POSITIVE_ONE, groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class})
    @Max(message = "执行状态错误", value = Integer.MAX_VALUE, groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class})
    @QueryParam(name = "executeStatus", code = "p.EXECUTE_STATUS")
    private Integer executeStatus;

    /**
     * 开始时间 EXECUTE_START_TIME
     */
    @QueryParam(name = "executeStartTime", code = "p.EXECUTE_START_TIME")
    private Date executeStartTime;

    /**
     * 结束时间 EXECUTE_END_TIME
     */
    @QueryParam(name = "executeEndTime", code = "p.EXECUTE_END_TIME")
    private Date executeEndTime;

    /**
     * 执行时间 DURATION
     */
    @NotNull(message = "请选择执行时间", groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class})
    @Min(message = "执行时间错误", value = NumeralUtil.POSITIVE_ONE, groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class})
    @Max(message = "执行时间错误", value = Integer.MAX_VALUE, groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class})
    @QueryParam(name = "duration", code = "p.DURATION")
    private Integer duration;

    /**
     * 结果 RESULT
     */
    @NotBlank(message = "请输入结果", groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class})
    @Size(message = "结果最多2000字符", max = 2000, groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class})
    @QueryParam(name = "result", code = "p.RESULT")
    private String result;

    /**
     * t_scheduled_tasks_log
     */
    private static final long serialVersionUID = 1L;

    public Long getScheduledTasksId() {
        return scheduledTasksId;
    }

    public void setScheduledTasksId(Long scheduledTasksId) {
        this.scheduledTasksId = scheduledTasksId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code == null ? null : code.trim();
    }

    public String getParam() {
        return param;
    }

    public void setParam(String param) {
        this.param = param == null ? null : param.trim();
    }

    public Integer getExecuteIndex() {
        return executeIndex;
    }

    public void setExecuteIndex(Integer executeIndex) {
        this.executeIndex = executeIndex;
    }

    public Integer getExecuteStatus() {
        return executeStatus;
    }

    public void setExecuteStatus(Integer executeStatus) {
        this.executeStatus = executeStatus;
    }

    public Date getExecuteStartTime() {
        return executeStartTime;
    }

    public void setExecuteStartTime(Date executeStartTime) {
        this.executeStartTime = executeStartTime;
    }

    public Date getExecuteEndTime() {
        return executeEndTime;
    }

    public void setExecuteEndTime(Date executeEndTime) {
        this.executeEndTime = executeEndTime;
    }

    public Integer getDuration() {
        return duration;
    }

    public void setDuration(Integer duration) {
        this.duration = duration;
    }

    public String getResult() {
        return result;
    }

    public void setResult(String result) {
        this.result = result == null ? null : result.trim();
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", scheduledTasksId=").append(scheduledTasksId);
        sb.append(", name=").append(name);
        sb.append(", code=").append(code);
        sb.append(", param=").append(param);
        sb.append(", executeIndex=").append(executeIndex);
        sb.append(", executeStatus=").append(executeStatus);
        sb.append(", executeStartTime=").append(executeStartTime);
        sb.append(", executeEndTime=").append(executeEndTime);
        sb.append(", duration=").append(duration);
        sb.append(", result=").append(result);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ScheduledTasksLog other = (ScheduledTasksLog) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getCreateId() == null ? other.getCreateId() == null : this.getCreateId().equals(other.getCreateId()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getOperaterStatus() == null ? other.getOperaterStatus() == null : this.getOperaterStatus().equals(other.getOperaterStatus()))
            && (this.getScheduledTasksId() == null ? other.getScheduledTasksId() == null : this.getScheduledTasksId().equals(other.getScheduledTasksId()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getCode() == null ? other.getCode() == null : this.getCode().equals(other.getCode()))
            && (this.getParam() == null ? other.getParam() == null : this.getParam().equals(other.getParam()))
            && (this.getExecuteIndex() == null ? other.getExecuteIndex() == null : this.getExecuteIndex().equals(other.getExecuteIndex()))
            && (this.getExecuteStatus() == null ? other.getExecuteStatus() == null : this.getExecuteStatus().equals(other.getExecuteStatus()))
            && (this.getExecuteStartTime() == null ? other.getExecuteStartTime() == null : this.getExecuteStartTime().equals(other.getExecuteStartTime()))
            && (this.getExecuteEndTime() == null ? other.getExecuteEndTime() == null : this.getExecuteEndTime().equals(other.getExecuteEndTime()))
            && (this.getDuration() == null ? other.getDuration() == null : this.getDuration().equals(other.getDuration()))
            && (this.getResult() == null ? other.getResult() == null : this.getResult().equals(other.getResult()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getCreateId() == null) ? 0 : getCreateId().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getOperaterStatus() == null) ? 0 : getOperaterStatus().hashCode());
        result = prime * result + ((getScheduledTasksId() == null) ? 0 : getScheduledTasksId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getCode() == null) ? 0 : getCode().hashCode());
        result = prime * result + ((getParam() == null) ? 0 : getParam().hashCode());
        result = prime * result + ((getExecuteIndex() == null) ? 0 : getExecuteIndex().hashCode());
        result = prime * result + ((getExecuteStatus() == null) ? 0 : getExecuteStatus().hashCode());
        result = prime * result + ((getExecuteStartTime() == null) ? 0 : getExecuteStartTime().hashCode());
        result = prime * result + ((getExecuteEndTime() == null) ? 0 : getExecuteEndTime().hashCode());
        result = prime * result + ((getDuration() == null) ? 0 : getDuration().hashCode());
        result = prime * result + ((getResult() == null) ? 0 : getResult().hashCode());
        return result;
    }
}